package org.huangrui.redis.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.huangrui.redis.service.OrderService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author hr
 * @Create 2024-05-01 13:52
 */
@Tag(name = "订单模块",description = "订单接口")
@RestController
public class OrderController {
    @Resource
    private OrderService orderService;

    @Operation(summary = "新增订单",description = "新增订单方法")
    @RequestMapping(value = "/order/add",method = RequestMethod.POST)
    public void addOrder()
    {
        orderService.addOrder();
    }

    @Operation(summary = "查询订单",description = "按照keyIdc查询订单")
    @RequestMapping(value = "/order/{keyId}",method = RequestMethod.GET)
    public String getOrderById(@PathVariable Integer keyId){
        return orderService.getOrderById(keyId);
    }
}
